 // JavaScript program to print level order traversal
      // in spiral form using one queue and one stack.
      // Representation of a node

      //数组是倒着插入
      //插入是从右到左，最先插入的节点是数组的尾部，因为第1个插入的是head
      //历遍是从左到右，
      class Node {
        constructor() {
          this.data = 0;
          this.next = null;
        }
      }
      var root;
 
      // Function to insert node
      function insert(root, item) {
        var temp = new Node();
        temp.data = item;
        temp.next = root;
        root = temp;
        return root;
      }
 
      function display(root) {
        while (root != null) {
          console.log(root.data + " ");
          root = root.next;
        }
      }
 
      function arrayToList(arr, n) {
        root = null;
        for (var i = n - 1; i >= 0; i--) root = insert(root, arr[i]);
        return root;
      }
 
      // Driver code
      var arr = [1, 2, 3, 4, 5];
      var n = arr.length;
      var root = arrayToList(arr, n);
      display(root);

      var a=null;
      var b=null;
     b=a=new Node();
      a.data="hello";
      a.next=new Node();
      a.next.data="c";
      a.data="ok"
     console.log(a,b);